<div class="menus index">
    <h2><?php echo __('Menus'); ?></h2>
    <div class="left-menu">

    <h3><?php 
        echo __('Actions'); ?></h3>
        <?php echo $this->Form->create('Menu', array('action'=>'add')); ?>
    <fieldset>
        <?php echo __('Category'); ?>
        <?php
        echo $this->Form->input('title', array('class'=>'form-control'));
                echo $this->Form->input('type', array('type'=>'hidden', 'value'=>'categories'));
                echo $this->Form->input('parent_id', array('name' => 'data[Menu][url]', 'class'=>'form-control'));
                echo '<label>Position </label>'.$this->Form->select('position', array('Top','Bottom','Left'), array('class'=>'form-control'));
                ?>
            </fieldset>
        <?php echo $this->Form->end(__('Submit')); ?>
     <?php echo $this->Form->create('Menu', array('action'=>'add')); ?>
    <fieldset>
        <?php echo __('Page'); ?>
        <?php                     //   print_r($pages);
        echo $this->Form->input('title', array('class'=>'form-control'));
                echo $this->Form->input('type', array('type'=>'hidden', 'value'=>'posts')); 
                
                ?>
        <label>select page</label>
        <select name="data[Menu][url]" class="form-control">
            
            <?php foreach($posts as $page) { ?>
            <option value="<?php echo $page['Post']['id']; ?>"><?php echo $page['Post']['title']; ?></option>
            <?php } ?>
        </select>
            
                <?php
                echo '<label>Position </label>'.$this->Form->select('position', array('Top','Bottom','Left'), array('class'=>'form-control'));
                ?>
            </fieldset>
        <?php echo $this->Form->end(__('Submit')); ?>
           
</div>

    <div class="right-menu">
    <table cellpadding="0" cellspacing="0">
        <tr>
            <th><?php echo $this->Paginator->sort('id'); ?></th>
            <th><?php echo $this->Paginator->sort('title'); ?></th>
            <th><?php echo $this->Paginator->sort('url'); ?></th>
            <th><?php echo $this->Paginator->sort('position'); ?></th>
            <th><?php echo $this->Paginator->sort('order'); ?></th>
            <th class="actions"><?php echo __('Actions'); ?></th>
        </tr>
        <?php foreach ($menus as $menu): ?>
            <tr>
                <td><?php echo h($menu['Menu']['id']); ?>&nbsp;</td>
                <td><?php echo h($menu['Menu']['title']); ?>&nbsp;</td>
                <td><?php echo h($menu['Menu']['url']); ?>&nbsp;</td>
                <td><?php echo h($menu['Menu']['position']); ?>&nbsp;</td>
                <td><?php echo h($menu['Menu']['order']); ?>&nbsp;</td>
                <td class="actions">
                      <?php echo $this->Html->link($this->Html->image('view.png'), array('action' => 'view', $menu['Menu']['id']),array('class'=>'shortcut','escape' => false)); ?>
			<?php echo $this->Html->link($this->Html->image('edit.png'), array('action' => 'edit', $menu['Menu']['id']),array('class'=>'shortcut','escape' => false)); ?>
			<?php  
                        echo $this->Form->postLink($this->Html->image('delete.png',
                            array("alt" => __('Delete'), "title" => __('Delete'))), 
                         array('action' => 'delete', $menu['Menu']['id']), 
                         array('escape' => false, 'confirm' => __('Are you sure?')));?>
                   
                </td>
            </tr>
        <?php endforeach; ?>
    </table>
    <p>
        <?php
        echo $this->Paginator->counter(array(
            'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
        ));
        ?>	</p>
    <div class="paging">
        <?php
        echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
        echo $this->Paginator->numbers(array('separator' => ''));
        echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
        ?>
    </div>
</div>
    </div>
